package com.ktgj.hotel.api;

import com.ktgj.common.core.constant.ServiceNameConstants;
import com.ktgj.common.core.domain.R;
import com.ktgj.common.core.web.domain.AjaxResult;
import com.ktgj.hotel.api.domain.*;
import com.ktgj.hotel.api.factory.RemoteHotelFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(contextId = "RemoteHotelService", name = ServiceNameConstants.Hotel_Service, fallbackFactory = RemoteHotelFallbackFactory.class)
public interface RemoteHotelService {

    /**
     * 查询全部省信息(远程)
     */
    @PostMapping("/province/allDicProvince")
    public List<DicProvinceVoApi> allDicProvince();

    /**
     * 查询全部市信息(远程)
     * */
    @PostMapping("/city/allDicCityList")
    public List<DicCityVoApi> allDicCityList();

    /**
     * 查询全部县信息(远程)
     * */
    @PostMapping("/county/allDicCountyList")
    public List<DicCountyVoApi> allDicCountyList();

    /**
     * 跟据县、区名称查询信息（远程）
     * */
    @PostMapping("/county/countyId")
    public DicCountyVoApi countyId(@RequestParam("countyName") String countyName);

    /**
     * 查询酒店订单量
     * */
    @PostMapping("/order/hotelOrderNum")
    public List<HotelOrderApi> hotelOrderNum(@RequestBody Map<String, Object> map);

    /**
     * 获取用户下有多少笔酒店订单
     */
    @PostMapping("/order/queryHotelOrderNumber")
    public int queryHotelOrderNumber(@RequestBody Long customerId);

    /**
     * 城市名称查经纬度
     * */
    @PostMapping("/city/dicCityLngAnfLat")
    public String dicCityLngAnfLat(@RequestBody Map<String, Object> map);

    /**
     * 行程酒店订单
     * */
    @PostMapping("/order/journeyHotelVo")
    public JourneyHotelVoApi journeyHotelVo(@RequestBody Map<String, Object> map);

    /**
     * 获取城市名称
     * */
    @PostMapping("/city/selectCityName")
    public DicCityApi selectCityName(@RequestBody Map<String, Object> map);

    /**
     * 获取城市id
     * */
    @PostMapping("/city/selectCityId")
    public Long selectCityId(@RequestBody Map<String, Object> map);

    /**
     * 获取酒店订单详情
     * @param orderid
     * @return
     */
    @GetMapping("/order/getInfo")
    public R<HotelOrder> getInfo(@RequestParam("orderid") Long orderid);

    /**
     * 查询支付明细
     *
     * @param orderid 订单ID
     * @return 支付明细
     */
    @GetMapping("/paydetail/selectHotelOrderPaydetailByorderId")
    public R<HotelOrderPaydetail> selectHotelOrderPaydetailByorderId(@RequestParam("orderid") Long orderid);

    /**
     * 修改酒店订单
     */
    @PostMapping("/order/edit")
    public AjaxResult edit(@RequestBody HotelOrder hotelOrder);

    /**
     * 修改支付明细
     *
     * @param hotelOrderPaydetail 支付明细
     * @return 结果
     */
    @PostMapping("/updateOrderPaydetailByOrderId")
    public AjaxResult updateOrderPaydetailByOrderId(@RequestBody HotelOrderPaydetail hotelOrderPaydetail);

    /**
     * 订单id获取酒店订单信息
     * */
    @PostMapping("/order/order")
    public HotelOrder order(@RequestBody Map<String, Object> map);

    /**
     * 条件查询酒店订单列表
     * */
    @PostMapping("/hotel/orderList")
    public HotelOrderPaginationVo orderList(@RequestBody HotelParameterVo hotelParameterVo);

    /**
     * 订单号获取酒店订单信息
     * */
    @PostMapping("/order/orderNum")
    public HotelOrder orderNum(@RequestBody Map<String, Object> map);

    @PostMapping("/order/hotelOrderListThings")
    public List<HotelOrder> orderListThings();
}
